class IpConfig {
  String name;
  String macName;
  String ip;
  String mask;
  String gateway;
  String defaultDns;
  String spareDns;

  IpConfig({
    this.name,
    this.macName,
    this.ip,
    this.mask,
    this.gateway,
    this.defaultDns,
    this.spareDns,
  });

  factory IpConfig.fromMap(dynamic map) {
    if (null == map) return null;
    var temp;
    return IpConfig(
      name: map['name']?.toString(),
      macName: map['macName']?.toString(),
      ip: map['ip']?.toString(),
      mask: map['mask']?.toString(),
      gateway: map['gateway']?.toString(),
      defaultDns: map['defaultDns']?.toString(),
      spareDns: map['spareDns']?.toString(),
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'name': name,
      'macName': macName,
      'ip': ip,
      'mask': mask,
      'gateway': gateway,
      'defaultDns': defaultDns,
      'spareDns': spareDns,
    };
  }
}
